package com.sptpc.demo.service.impl;

import com.sptpc.demo.global.exception.BusinessException;
import com.sptpc.demo.global.response.BusinessStatusCode;
import com.sptpc.demo.mapper.OrderMapper;
import com.sptpc.demo.model.Order;
import com.sptpc.demo.service.IOrderService;
import com.sptpc.demo.vo.OrderWithDrinksVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService implements IOrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public OrderWithDrinksVo findOrdersById(Long id) {
        return orderMapper.selectWithDrinksByPrimaryKey(id);
    }

    @Override
    public void addNewOrder(Order order, List<Integer> items) {
        throw new BusinessException(BusinessStatusCode.DRINK_NOT_FOUND);
    }
}
